package net.jeeshop.web.util;

/**
 * Created by xvhuichuang on 2017/7/12.
 */
public class ResultUtil extends ResponseUtil {

    public final String SUCCESS = "success";
    public final String ERROR = "error";

    public String error(String msg){
        setFailed();
        setMsg(msg);
        return this.toJsonStr();
    }

    public String success(String msg){
        setSuccess();
        setMsg(msg);
        return this.toJsonStr();
    }

    public String success(){
        setSuccess();
        setMsg(SUCCESS);
        return this.toJsonStr();
    }

    public String error(){
        setSuccess();
        setMsg(ERROR);
        return this.toJsonStr();
    }
}
